package com.dlyk.mapper;

import com.dlyk.commons.DataScope;
import com.dlyk.model.User;
import com.dlyk.query.BaseQuery;

import java.util.List;

public interface UserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    User selectByLoginAct(String userName);

    // user表：表的别名u，表的字段id，根据id字段进行过滤
    @DataScope(tableAlias = "u", tableField = "id")
    // 注意：拼接where条件的参数必须是方法的第一个参数
    List<User> selectUserListByPage(BaseQuery query);

    User selectUserDetailById(Integer id);

    int deleteByIds(List<String> ids);

    List<User> selectOwnerList();

    List<User> selectAllLegitimateUser();

    List<User> selectUserListByRoleId(Integer roleId);

    List<User> selectNotOwnedRoleUserList();
}

